﻿using Mes.Pendant.SupplierReturn.IAppService;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace Mes.Pendant.Web.Controllers
{
	public class SupplierReturnController : Controller
	{
		private readonly ISupplierReturnAppService iSupplierReturnAppService;

		public SupplierReturnController(ISupplierReturnAppService iSupplierReturnAppService)
		{
			this.iSupplierReturnAppService = iSupplierReturnAppService;
		}

		public IActionResult SupplierReturnList()
		{
			return View();
		}


		[HttpGet]
		public async Task<JsonResult> GetSupplierReturnList(int page, int limit, string? returnName, string? startDate, string? endDate)
		{
			var result = await iSupplierReturnAppService.GetSupplierReturnList(page, limit, returnName, startDate, endDate);
			//return  Json(result);
			return Json(new { data = result.Queryable, count = result.RowCount, code = 0, msg = "" });
		}





	}
}
